// To parse this JSON data, do
//
//     final myCollectData = myCollectDataFromJson(jsonString);

import 'dart:convert';

MyCollectData myCollectDataFromJson(String str) =>
    MyCollectData.fromJson(json.decode(str));

String myCollectDataToJson(MyCollectData data) => json.encode(data.toJson());

class MyCollectData {
  MyCollectData({
    this.id,
    this.fileUrls,
    this.source,
    this.content,
    this.title,
    this.myCollectDataId,
    this.collect,
  });

  String id;
  List<dynamic> fileUrls;
  String source;
  String content;
  String title;
  String myCollectDataId;
  Collect collect;

  factory MyCollectData.fromJson(Map<String, dynamic> json) => MyCollectData(
        id: json["_id"],
        fileUrls: List<dynamic>.from(json["file_urls"].map((x) => x)),
        source: json["source"],
        content: json["content"],
        title: json["title"],
        myCollectDataId: json["id"],
        collect: Collect.fromJson(json["collect"]),
      );

  Map<String, dynamic> toJson() => {
        "_id": id,
        "file_urls": List<dynamic>.from(fileUrls.map((x) => x)),
        "source": source,
        "content": content,
        "title": title,
        "id": myCollectDataId,
        "collect": collect.toJson(),
      };
}

class Collect {
  Collect({
    this.id,
    this.objId,
    this.objType,
    this.userId,
    this.v,
    this.collectId,
    this.createdTime,
    this.updatedTime,
  });

  String id;
  String objId;
  int objType;
  String userId;
  int v;
  String collectId;
  DateTime createdTime;
  DateTime updatedTime;

  factory Collect.fromJson(Map<String, dynamic> json) => Collect(
        id: json["_id"],
        objId: json["obj_id"],
        objType: json["obj_type"],
        userId: json["user_id"],
        v: json["__v"],
        collectId: json["collect_id"],
        createdTime: DateTime.parse(json["created_time"]),
        updatedTime: DateTime.parse(json["updated_time"]),
      );

  Map<String, dynamic> toJson() => {
        "_id": id,
        "obj_id": objId,
        "obj_type": objType,
        "user_id": userId,
        "__v": v,
        "collect_id": collectId,
        "created_time": createdTime.toIso8601String(),
        "updated_time": updatedTime.toIso8601String(),
      };
}
